<template>
  <div class="tetris-board">
    <div v-for="(row, y) in board" :key="y" class="row">
      <div 
        v-for="(cell, x) in row" 
        :key="x" 
        :class="['cell', { filled: cell.filled }]"
        :style="{ backgroundColor: cell.filled ? cell.color : '' }"
      ></div>
    </div>
  </div>
</template>

<script setup lang="ts">
interface BoardCell {
  filled: boolean;
  color: string;
}

defineProps<{
  board: BoardCell[][];
}>();
</script>

<script lang="ts">
export default {
  name: 'TetrisBoard'
}
</script>

<style scoped>
.tetris-board {
  border: 2px solid #333;
  background: #111;
  padding: 4px;
}

.row {
  display: flex;
}

.cell {
  width: 25px;
  height: 25px;
  border: 1px solid #333;
  transition: background-color 0.1s;
}

.cell.filled {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}
</style>